package com.kx.smsolatform.controller;

import com.kx.smsolatform.service.SearcherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * @Author Sun
 * @Date 2021/7/6 17:37
 */
@RestController
public class SearcherController {

    @Autowired
    private SearcherService searcherService;

    @RequestMapping(value = "/search/search", method = RequestMethod.POST)
    List<Map> searchLog(@RequestParam("params") String paras) throws IOException {
        return searcherService.searchLog(paras);
    }

    @RequestMapping(value = "/search/searchcount", method = RequestMethod.POST)
    Long searchLogCount(@RequestParam("params") String paras) throws IOException {
        return searcherService.searchLogCount(paras);
    }

    @RequestMapping(value = "/search/statStatus", method = RequestMethod.POST)
    Map<String, Long> statSendStatus(@RequestParam("params") String paras) throws IOException {
        return searcherService.statSendStatus(paras);
    }
}
